#include <iostream>
using namespace std;

enum Context{c_comment,cpp_comment,string_literal,char_literal,file_end};


void handle_cpp_comment()
{
    char c;
    while(cin.get(c) && c != '\n')
    {
    }
}
void handle_c_comment()
{
    char c;
    while( cin.get(c))
    {
        if (c == '*')
        {
            while( cin.get(c) && c == '*')
            if ( c == '/')
                return;
        }
    }
}

void handle_literal(char delimiter)
{
    cout << delimiter;
    char c;
    while(cin.get(c))
    {
        cout << c;
        if( c == delimiter)
        {
            break;
        }
        if( c == '\\')
        {
            cin.get(c) && cout << c;
        }
    }
    
}

Context handle_code()
{
    char c;
    while(cin.get(c))
    {
        switch(c)
        {
        case  '/':
            if( !cin.get(c))
            {
                cout << "/";//This means c++ code error
                return file_end;
            }
            else
            {
                if( c == '/')
                {
                    return cpp_comment;
                }
                if( c == '*')
                {
                    return c_comment;
                }
            }
        case '\"':
            return string_literal;
        case '\'':
            return char_literal;
        default:
            cout << c;
        }
    }
        
}

int main()
{
    Context context;
    while(( context = handle_code()) != file_end)
    {
        switch(context)
        {
        case c_comment:
            handle_c_comment();
            break;
        case cpp_comment:
            handle_cpp_comment();
            break;
        case string_literal:
            handle_literal('\"');
            break;
        case char_literal:
            handle_literal('\'');
            break;
        }
    }
    return 0;
}
